import request from '@/utils/request'

// 查询采购采退汇总列表
export function listPurchase(query) {
  return request({
    url: '/supermarket/purchase/list',
    method: 'get',
    params: query
  })
} 

export function listPurchaseCs(query) {
  return request({
    url: '/supermarket/purchase/cSlist',
    method: 'get',
    params: query
  })
}
export function listPurchaseTwo(query) {
  return request({
    url: '/supermarket/purchase/listTwo',
    method: 'get',
    params: query
  })
}
export function listPurchaseThree(query) {
  return request({
    url: '/supermarket/purchase/listThree',
    method: 'get',
    params: query
  })
}
export function listPurchaseZf(query) {
  return request({
    url: '/supermarket/purchase/listPurchaseZf',
    method: 'get',
    params: query
  })
}


// 查询采购采退汇总详细
export function getPurchase(purchaseId) {
  return request({
    url: '/supermarket/purchase/' + purchaseId,
    method: 'get'
  })
}

// 新增采购采退汇总
export function addPurchase(data) {
  return request({
    url: '/supermarket/purchase',
    method: 'post',
    data: data
  })
}

// 修改采购采退汇总
export function updatePurchase(data) {
  return request({
    url: '/supermarket/purchase',
    method: 'put',
    data: data
  })
}

// 删除采购采退汇总
export function delPurchase(purchaseId) {
  return request({
    url: '/supermarket/purchase/' + purchaseId,
    method: 'delete'
  })
}

// 删除采购采退汇总
export function ark(data) {
  return request({
    url: '/supermarket/purchase/rk',
    method: 'post',
    data: data
  })
}

//审核采购采退单
export function auditPurchase(data) {
  return request({
    url: '/supermarket/purchase/audit',
    method: 'post',
    data: data
  })
}

//出库操作
export function purchaseOutStore(purchaseId) {
  return request({
    url: '/supermarket/purchase/outStore/' + purchaseId,
    method: 'get',
  })
}

// 支付单新增
export function payPurchase(ids) {
  return request({
    url: '/supermarket/purchase/pay/'+ ids,
    method: 'get',
  })
}

// 删除采购采退汇总
export function zfPurchase(id) {
  return request({
    url: '/supermarket/purchase/zfPurchase/'+ id,
    method: 'get',
  })
}
